// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
// Vuex 依赖 Promise。兼容浏览器并没有实现 Promise (比如 IE)
import Print from '@/utils/print'
import 'es6-promise/auto'
import Vuex from 'vuex'
import ElementUI from 'element-ui';
import './assets/scss/element-variables.scss'
import apis from './utils/apis'
import ajax from './utils/ajax'
import validate from './utils/validator'
import VueCropper from 'vue-cropper'
import Editor from 'wangeditor'
import formatData from './utils/formatData'
// 图片
import Viewer from 'v-viewer'
import 'viewerjs/dist/viewer.css'

// 引入 iconfont图标
import '@/assets/icon/iconfont.css'

import Table from '@/components/Table/index'
import Pagination from '@/components/Pagination/index'
import TitleTip from '@/components/TitleTip/index'
import Date from '@/components/Date/index'
import Cropper from '@/components/Cropper/index'
import AreaInput from '@/components/AreaInput/index'
import DataList from '@/components/DataList/index'

Vue.config.productionTip = false
Vue.use(Vuex)
Vue.use(ElementUI)
Vue.use(VueCropper)
Vue.use(Viewer)
Vue.use(Print)
Viewer.setDefaults({
  Options: {
    "inline": true,
    "button": true,
    "navbar": true,
    "title": true,
    "toolbar": true,
    "tooltip": true,
    "movable": true,
    "zoomable": true,
    "rotatable": true,
    "scalable": true,
    "transition": true,
    "fullscreen": true,
    "keyboard": true,
    "url": "data-source"
  }
});

// window.$bus = new Vue()
window.apis = apis
window.ajax = ajax
window.validate = validate
window.Editor = Editor
// 数据处理
window.formatData = formatData

Vue.component(Table.name,Table)
Vue.component(DataList.name,DataList)
Vue.component(AreaInput.name,AreaInput)
Vue.component(TitleTip.name,TitleTip)
Vue.component(Cropper.name,Cropper)
Vue.component(Date.name,Date)
Vue.component(Pagination.name,Pagination)

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
